﻿<UserControl
	x:Class="TestGUI.Page1"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
	xmlns:me="clr-namespace:TestGUI"
	xmlns:MVVMSL="clr-namespace:Riba.MVVMSL;assembly=RibaMVVMSL"
	mc:Ignorable="d" d:DesignHeight="150" d:DesignWidth="300"
>
	<UserControl.DataContext>
		<me:Page1ViewModel/>
	</UserControl.DataContext>
	<UserControl.Resources>
		<Style TargetType="TextBox">
			<Setter Property="me:TextBoxBindingHelper.UpdateSourceOnChange" Value="True" />
		</Style>
	</UserControl.Resources>

	<Border Background="Bisque">
		<Grid>
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
				<RowDefinition Height="Auto" />
				<RowDefinition Height="Auto" />
				<RowDefinition Height="Auto" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="100" />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>

			<MVVMSL:ViewEventHandlerControl />

			<TextBlock Text="Page1" Grid.ColumnSpan="2" />

			<TextBlock Text="ExchangeData" Grid.Row="1" />
			<TextBox Text="{Binding ExchangeData, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" />

			<TextBlock Text="PrivateData" Grid.Row="2" />
			<TextBox Text="{Binding PrivateData, Mode=TwoWay}" Grid.Row="2" Grid.Column="1" />

			<!-- Sample for InvokeCommandAction, uses System.Windows.Interactivity from Expression Blend -->
			<Border Grid.Row="3" Grid.Column="1" Width="170" Background="Coral">
				<TextBlock Text="Move your mouse over me">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="MouseEnter">
							<i:InvokeCommandAction Command="{Binding CommandMouseEnter}" CommandParameter="123" />
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</TextBlock>
			</Border>
		</Grid>
	</Border>
</UserControl>
